package bold.deposit.useful;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class PropUtil2   {

    /**
     * 这种写法就是 热加载 修改配置文件也有用
     * 可以定时 10分钟重新加载文件
     */
    public static void main(String[] args) throws IOException {
        String path = Thread.currentThread().getContextClassLoader().getResource("").getPath();

        Properties prop = new Properties();
        prop.load(new FileInputStream(path + "prop.properties"));
        System.out.println(prop.get("key1"));

        prop.load(new FileInputStream(path + "prop.properties"));
        System.out.println(prop.get("key1"));
    }
}
